'\" te
.\" This manual page is derived from the DAT/uDAPL 1.2 specification.
.\" Portions Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH DAT_SRQ_QUERY 3DAT "Jul 16, 2004"
.SH NAME
dat_srq_query \- provide parameters of the shared receive queue
.SH SYNOPSIS
.LP
.nf
cc [ \fIflag\fR\&.\|.\|. ] \fIfile\fR\&.\|.\|. \fB-ldat\fR [ \fIlibrary\fR\&.\|.\|. ]
#include <\fBdat/udat.h\fR>

DAT_RETURN
    dat_srq_query (
    IN      DAT_SRQ_HANDLE      srq_handle,
    IN      DAT_SRQ_PARAM_MASK  srq_param_mask,
    OUT     DAT_SRQ_PARAM       *srq_param
    )
.fi

.SH PARAMETERS
.sp
.ne 2
.na
\fB\fIsrq_handle\fR\fR
.ad
.RS 18n
A handle for an instance of the SRQ.
.RE

.sp
.ne 2
.na
\fB\fIsrq_param_mask\fR\fR
.ad
.RS 18n
The mask for SRQ parameters.
.RE

.sp
.ne 2
.na
\fB\fIsrq_param\fR\fR
.ad
.RS 18n
A pointer to a Consumer-allocated structure that the Provider fills with SRQ
parameters.
.RE

.SH DESCRIPTION
.sp
.LP
The \fBdat_srq_query()\fR function provides to the Consumer SRQ parameters. The
Consumer passes a pointer to the Consumer-allocated structures for SRQ
parameters that the Provider fills.
.sp
.LP
The \fIsrq_param_mask\fR argument allows Consumers to specify which parameters
to query. The Provider returns values for the requested \fIsrq_param_mask\fR
parameters. The Provider can return values for any other parameters.
.sp
.LP
In addition to the elements in SRQ attribute, \fBdat_srq_query()\fR provides
additional information in the \fBsrq_param\fR structure if Consumer requests it
with \fIsrq_param_mask\fR settings. The two that are related to entry counts on
SRQ are the number of Receive buffers (\fIavailable_dto_count\fR) available for
EPs to dequeue and the number of occupied SRQ entries
(\fIoutstanding_dto_count\fR) not available for new Recv buffer postings.
.SH RETURN VALUES
.sp
.ne 2
.na
\fB\fBDAT_SUCCESS\fR\fR
.ad
.RS 25n
The operation was successful.
.RE

.sp
.ne 2
.na
\fB\fBDAT_INVALID_PARAMETER\fR\fR
.ad
.RS 25n
The \fIsrq_param_mask\fR argument is invalid.
.RE

.sp
.ne 2
.na
\fB\fBDAT_INVALID_HANDLE\fR\fR
.ad
.RS 25n
The \fIsrq_handle\fR argument is an invalid DAT handle.
.RE

.SH USAGE
.sp
.LP
The Provider might not be able to provide the number of outstanding Recv of SRQ
or available Recvs of SRQ. The Provider attribute indicates if the Provider
does not support the query for one or these values. Even when the Provider
supports the query for one or both of these values, it might not be able to
provide this value at this moment. In either case, the return value for the
attribute that cannot be provided will be \fBDAT_VALUE_UNKNOWN\fR.
.sp
.LP
Example: Consumer created SRQ with 10 entries and associated 1 EP with it. 3
Recv buffers have been posted to it. The query will report:
.sp
.in +2
.nf
max_recv_dtos=10,
available_dto_count=3,
outstanding_dto_count=3.
.fi
.in -2
.sp

.sp
.LP
After a Send message arrival the query will report:
.sp
.in +2
.nf
max_recv_dtos=10,
available_dto_count=2,
outstanding_dto_count=3.
.fi
.in -2
.sp

.sp
.LP
After Consumer dequeues Recv completion the query will report:
.sp
.in +2
.nf
max_recv_dtos=10,
available_dto_count=2,
outstanding_dto_count=2.
.fi
.in -2
.sp

.sp
.LP
In general, each EP associated with SRQ can have multiple buffers in progress
of receiving messages as well completed Recv on EVDs. The watermark setting
helps to control how many Recv buffers posted to SRQ an Endpoint can own.
.sp
.LP
If the Provider cannot support the query for the number of outstanding Recv of
SRQ or available Recvs of SRQ, the value return for that attribute should be
\fBDAT_VALUE_UNKNOWN\fR.
.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(7) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Interface Stability	Standard: uDAPL, 1.2
_
MT-Level	Unsafe
.TE

.SH SEE ALSO
.sp
.LP
.BR dat_srq_create (3DAT),
.BR dat_srq_free (3DAT),
.BR dat_srq_post_recv (3DAT),
.BR dat_srq_resize (3DAT),
.BR dat_srq_set_lw (3DAT),
.BR libdat (3LIB),
.BR attributes (7)
